package com.example.harmonyos_orm.viewholder;

import com.example.harmonyos_orm.ResourceTable;
import com.example.harmonyos_orm.database.PhotoItem;
import com.zhushenwudi.hmutils.adapter.EventTransmissionListener;
import com.zhushenwudi.hmutils.adapter.SuperProvider;
import com.zhushenwudi.hmutils.adapter.ViewHolder;
import ohos.agp.components.Component;
import ohos.agp.components.Image;

public class PhotoViewHolder extends ViewHolder<PhotoItem> {
    private Image image;

    public PhotoViewHolder(EventTransmissionListener eventTransmissionListener, Component component, SuperProvider provider) {
        super(eventTransmissionListener, component, provider);
        image = (Image) findComponentById(ResourceTable.Id_image);
    }

    @Override
    public void onDataBound() {
        image.setPixelMap(getModel().getPath());
    }
}
